package nyist.media.bean.role;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import nyist.media.entity.admin.MenuAuth;
import nyist.media.entity.admin.Role;

/**
 *  角色详情
 * @author dcf
 */
@Getter
@Setter
@NoArgsConstructor
public class RoleInfoBean extends RoleListBean {

    private static final long serialVersionUID = -854257176318451832L;

    /**
     * 权限ids
     */
    private Long[] menuAuthIds;

    public RoleInfoBean(Role role){
        super(role);
        menuAuthIds = role.getAuths().stream().map(MenuAuth::getId).toArray(Long[]::new);
    }
}
